package prueba;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class PruebaFormularios extends MIDlet implements CommandListener{
	Command avanza;
	Display display;
	Form form;
	Form form2;
	public PruebaFormularios() {
		// TODO Auto-generated constructor stub
		display=Display.getDisplay(this);
		form=new Form("Inicio");
		form2=new Form("Siguiente");
		display.setCurrent(form);
		avanza=new Command("avanza",Command.ITEM,1);
		
		form.addCommand(avanza);
		
		form.setCommandListener(this);
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		// TODO Auto-generated method stub

	}

	protected void pauseApp() {
		// TODO Auto-generated method stub

	}

	protected void startApp() throws MIDletStateChangeException {
		// TODO Auto-generated method stub

	}

	public void commandAction(Command arg0, Displayable arg1) {
		// TODO Auto-generated method stub
		if(arg0.equals(avanza))
			display.setCurrent(form2);
	}

}
